<a href='https://github.com/angular/angular.js/edit/v1.4.x/src/ngMessages/messages.js?message=docs(ngMessageExp)%3A%20describe%20your%20change...#L571' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.4.7/src/ngMessages/messages.js#L571' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">ngMessageExp</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
    <li>
      - directive in module <a href="api/ngMessages">ngMessages</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p><code>ngMessageExp</code> is a directive with the purpose to show and hide a particular message.
For <code>ngMessageExp</code> to operate, a parent <code>ngMessages</code> directive on a parent DOM element
must be situated since it determines which messages are visible based on the state
of the provided key/value map that <code>ngMessages</code> listens on.</p>

</div>




<div>
  

  
  <h2>Directive Info</h2>
  <ul>
    <li>This directive creates new scope.</li>
    <li>This directive executes at priority level 0.</li>
    
  </ul>

  
  <h2 id="usage">Usage</h2>
  <div class="usage">
  
    <pre><code class="lang-html">&lt;!-- using attribute directives --&gt;
&lt;ANY ng-messages=&quot;expression&quot;&gt;
  &lt;ANY ng-message-exp=&quot;expressionValue&quot;&gt;...&lt;/ANY&gt;
&lt;/ANY&gt;

&lt;!-- or by using element directives --&gt;
&lt;ng-messages for=&quot;expression&quot;&gt;
  &lt;ng-message when-exp=&quot;expressionValue&quot;&gt;...&lt;/ng-message&gt;
&lt;/ng-messages&gt;
</code></pre>
<p><a href="api/ngMessages">Click here</a> to learn more about <code>ngMessages</code> and <code>ngMessage</code>.</p>

  
  </div>
  
<section class="api-section">
  <h3>Arguments</h3>

<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        ngMessageExp
        | whenExp
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-expression">expression</a>
      </td>
      <td>
        <p>an expression value corresponding to the message key.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

</section>
  


  
</div>


